<?php 
namespace app\admin\validate;
use app\admin\code\AdminCode;
use app\admin\code\AuthCode;
use app\admin\code\BaseCode;
use app\admin\model\BaseModel;
use think\Validate;

class TagValidate extends BaseValidate
{
    protected $_rule = [
        'id'      =>  'require',
        'name'    =>  'require',
        'sort'    =>  'number',
    ];
    protected $_field = [
        'id'=>'标签',
        'name'=>'标签名字',
        'sort'=>'排序',
    ];
    protected $_message = [
        'id.require' => BaseCode::PARAM_CANT_EMPTY,
        'name.require' => BaseCode::PARAM_CANT_EMPTY,
        'sort.number' => BaseCode::PARAM_MUST_NUMBER,
    ];
    protected $_scene = [
        'del'    => ['id'],
        'update' => ['id','name'],
        'add'    => ['name'],
    ];
}


